{extend name="../../public/admin"}
{block name="title"}{:lang('添加土建')}{/block}
{block name="css"}

<script src="__PUBLIC__/public/validform/Validform_v5.3.2_min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/public/validform/style.css">
<!--图片-->
<link rel="stylesheet" href="__PUBLIC__/public/bian-ji-qi/themes/default/default.css"/>
<script src="__PUBLIC__/public/bian-ji-qi/kindeditor.js"></script>
<script src="__PUBLIC__/public/bian-ji-qi/lang/zh_CN.js"></script>
<script>
    KindEditor.ready(function (K) {
        var editor = K.editor({
            allowFileManager: true
        });

        K('#image3').click(function () {
            editor.loadPlugin('image', function () {
                editor.plugin.imageDialog({
                    showRemote: false,
                    imageUrl: K('#url3').val(),
                    clickFn: function (url, title, width, height, border, align) {
                        K('#url3').val(url);
                        editor.hideDialog();
                    }
                });
            });
        });
        K('#image4').click(function () {
            editor.loadPlugin('image', function () {
                editor.plugin.imageDialog({
                    showRemote: false,
                    imageUrl: K('#url4').val(),
                    clickFn: function (url, title, width, height, border, align) {
                        K('#url4').val(url);
                        editor.hideDialog();
                    }
                });
            });
        });
    });

</script>
{/block}
{block name="body"}

<div id="container">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">{:lang('添加土建')}</a></li>
    </ul>

    <div style="height: 20px;"></div>
    <div>
        <form action="{:url('procedures')}" method="post" id="form0" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$Request.param.id}">
            <div class="row">
                <div class="pull-left col-xs-4">
                    <div class="form-group input-group  select-right">
                        <label class="input-group-addon">{:lang('手续名称')}</label>
                        <input type="text"  class="form-control" value="{$data.name}" disabled>
                    </div>
                    <div class="form-group input-group  select-right">
                        <label class="input-group-addon">{:lang('办理手续文号')}</label>
                        <input type="text" name="index" class="form-control" datatype="*1-30" value="{$data.index}">
                    </div>
                    <div class="form-group input-group   select-right">
                        <label class="input-group-addon">{:lang('开具证明单位')}</label>
                        <input type="text" name="company" class="form-control" datatype="s1-50" value="{$data.company}">
                    </div>
                    {:lang('上传证明扫描件')}
                    <div class="form-group input-group  select-right">
                        <input type="text" name="company_img" datatype="*" id="url3" class="form-control" value="{$data.company_img}">
                        <label class="input-group-addon" id="image3">上传</label>
                    </div>
                    <div class="form-group input-group  select-right">
                        <label class="input-group-addon">{:lang('办理费用')}</label>
                        <input type="text" name="money" class="form-control" datatype="*1-10" value="{$data.money}">
                    </div>
                    <div class="form-group   select-right">
                        <label>{:lang('描述')}</label>
                        <textarea name="text" cols="30" rows="3" class="form-control" datatype="s1-200">{$data.text}</textarea>
                    </div>
                    <div class="form-group  text-center col-xs-8">
                        <button class="btn btn-info" id="html">{:lang('立即提交')}</button>
                    </div>
                </div>
                <div class="pull-left col-xs-4">
                    <div class="form-group input-group  select-right">

                        <input type="hidden" name="payment_money" class="form-control" datatype="*1-10" value="{$data.payment_money}">
                    </div>


                    <div class="form-group input-group  select-right">
                        <input type="hidden" name="payment_img"   class="form-control" value="{$data.payment_img}">

                    </div>

                </div>
            </div>


        </form>

    </div>

</div>
{/block}
{block name="js"}
<!--日期-->
<link rel="stylesheet" href="__PUBLIC__/public/time/css/jedate.css">
<script src="__PUBLIC__/public/time/jquery.jedate.min.js"></script>

<script>
    (() => {


        //表单验证
        var form = $('form').Validform({
            tiptype: 4,
            ajaxPost: true,
            beforeSubmit: function () {
                    layer.load(2);
            },
            callback: function (da) {
                layer.closeAll();
                if (da == 1) {
                    form.resetForm();
                    window.parent.location.reload(); //子窗口 刷新父页面
                    layer.msg('{:lang("成功")}', {icon: 1});
                }
                else {
                    console.log(da);
                    layer.msg('{:lang("失败")}', {icon: 2});
                }
            }

        });



    })();
</script>
{/block}